


import request from '@/utils/request'
// const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZ2VudElkIjoiMzAwMCIsInRpbWVzdGFtcCI6MTcxMjY4MDE1NSwidXNlcklkIjozMjIwMTIyMn0.QOJ9rlpxLFjliCcWT77Dpv3IRqw3zV9CcekCiIIyBSM"


/**
 * 获取用户信息
 */
export function GetUserInfo (params,token) {
    if(token){
        return request({
            method: 'GET',
            url:`${params}`,
            headers:{
                'X-Host':'mall.user.info.get',
                'X-token':token,
                'Referer':'https://m.maizuo.com/v5/'
            }
        })
    }

}


/**
 * 获取用户消费和余额信息
 */
export function GetUserExpenseInfo (params,token) {
    if(token){
        return request({
            method: 'GET',
            url:`${params}`,
            headers:{
                'X-Host':'mall.user.page.data',
                'X-token':token,
                'Referer':'https://m.maizuo.com/v5/'
            }
        })
    }else{
        return{
            status:66666,
            data:null
        }
    }
  }


/**
 * 上传图片
 */
export function uploadAvatar (formData,token) {
    if(token){
        return request({
            method: 'POST',
            url:'?k=523872',
            data:formData,
            headers:{
                'X-Host':'mall.img.upload',
                'X-token':token,
                'Referer':'https://m.maizuo.com/v5/'
            }
        })
    }

}

/**
 * 修改用户资料
 */
export function upUserInfo (userData,token) {
    if(token){
        return request({
            method: 'POST',
            url:'?k=7513813',
            data:userData,
            headers:{
                'X-Host':'mall.user.update',
                'X-token':token,
                'Referer':'https://m.maizuo.com/v5/'
            }
        })
    }
}
/**
 * 获取验证码
 */
export function getvercode (phoneData) {
    return request({
        method: 'POST',
        data:phoneData,
        headers:{
            'X-Host':'mall.user.sms-code.send',
            'Referer':'https://m.maizuo.com/v5/'
        }
    })
}


/**
 * 登录
 */
export function loginApi (phoneData) {

    return request({
        method: 'POST',
        url:'?k=7513813',
        data:phoneData,
        headers:{
            'X-Host':' mall.user.sms-code-login',
            'Referer':'https://m.maizuo.com/v5/'
        }
    })
}